#include"UdpServer.hpp"
#include"Dict.hpp"
#include<memory>

int main(int argc,char *argv[])
{
    if(argc!=2)
    {
        cerr<<"Usage: "<<argv[0] <<"local-port"<<endl;
        exit(0);
    }
    uint16_t port=stoi(argv[1]);
    EnableScreen();

    Dict dict("./dict.txt");
    func_t translate=bind(&Dict::Translate,&dict,placeholders::_1);

    unique_ptr<UdpServer> usvr=make_unique<UdpServer>(translate,port);//c++14标准

    usvr->InitServer();
    usvr->Start();
    return 0;

}

